package co.edu.usbcali.raju.games.chess.model;

import co.edu.usbcali.raju.games.chess.ChessGame;
import co.edu.usbcali.raju.games.chess.controller.ChessController;
import co.edu.usbcali.raju.games.chess.engine.ChessRuleEngine;
import co.edu.usbcali.raju.games.chess.helpers.PlBoardWrapper;
import co.edu.usbcali.raju.model.Board;
import co.edu.usbcali.raju.model.IEvaluator;

public class EvaluateStalemate implements IEvaluator {
	
	private static EvaluateStalemate instance;

	
	public static EvaluateStalemate getInstance() {
		if(instance==null){
			instance=new EvaluateStalemate();
		}
		return instance;
	}

	@Override
	public double evaluate(Board board,String player) {
		ChessBoard cBoard=(ChessBoard)board;
		if(PlBoardWrapper.getInstance().askForStalemate(cBoard)){
	/*		if(player.equals(ChessBoard.WHITE)){
				return ChessGame.MIN_UTILITY;
			}else{
			return ChessGame.MAX_UTILITY;
*/return ChessGame.MAX_UTILITY;
			}
		else
			return 0;
	}

}
